﻿using ZQNB.Common.Models;

namespace ZQNB.BaseLib.Core
{
    public interface ICloudAccountService
    {
        /// <summary>
        /// 初始化接口，可插入预置数据
        /// 有则修改，没有则插入
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <param name="passwordAlreadyEncrypted">密码是否已经加密，默认是明文</param>
        /// <returns></returns>
        void Init(string userName, string password, bool passwordAlreadyEncrypted = false);

        /// <summary>
        /// 验证账号
        /// </summary>
        /// <param name="identityName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        bool Validate(string identityName, string password);

        /// <summary>
        /// 修改密码
        /// 检测newpass是否符合要求 1 - 500
        /// </summary>
        /// <param name="identityName"></param>
        /// <param name="oldPass"></param>
        /// <param name="newPass"></param>
        /// <returns></returns>
        bool ChangePassword(string identityName, string oldPass, string newPass);

        /// <summary>
        /// 移除账号
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        void Remove(string userName);
    }
}